package za.co.yellowfire.solarflare;

import java.io.Serializable;
import java.util.*;

/**
 * @author Mark P Ashworth
 * @version 0.0.1
 */
public class SearchResult implements Serializable, Iterable {
    private static final long serialVersionUID = 1L;

    private List<Object> results = new ArrayList<Object>();
    private SearchSuggestions suggestions = new SearchSuggestions();

    public void add(Object object) {
        this.results.add(object);
    }

    public Object get(int index) {
        return results.get(index);
    }

    public List getResults() {
        return results;
    }

    public int size() {
        return results.size();
    }

    public SearchSuggestions getSuggestions() {
        return suggestions;
    }

    /**
     * Returns an iterator over a set of elements of type T.
     * @return an Iterator.
     */
    @Override
    public Iterator iterator() {
        return this.results.iterator();
    }
}
